﻿using System;
using System.Web.UI.WebControls;
using BLL.RF.Repair;

public partial class ProductRepair_ViewRepair_RepairLockView_RepairLockViewbySN : System.Web.UI.Page
{
    private RepairLock rl;
    private string sn
    {
        get { return ViewState["SN"].ToString(); }
        set { ViewState["SN"] = value; }
    }

    public ProductRepair_ViewRepair_RepairLockView_RepairLockViewbySN()
    {
        rl = new RepairLock();
    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        sn = CommHelper.GetProductSN(this.TextBox1.Text.Trim());
        BindGV();
    }

    protected void BindGV()
    {
        this.GridView1.DataSource = rl.RepairLock_GetbyProductSN(sn);
        this.GridView1.DataBind();
    }

    protected void GridView1_PageIndexChanging(object sender, System.Web.UI.WebControls.GridViewPageEventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        BindGV();
    }

    protected void GridView1_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            if ((bool)GridView1.DataKeys[e.Row.RowIndex].Values[2] == true)
            {
                e.Row.Cells[3].Text = "已锁定";
            }
            else
            {
                e.Row.Cells[3].Text = "已解锁";
            }
        }
    }
}
